package com.nbjtjc.safe.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @auther guqianbin
 * @date 2018/8/6 15:08
 **/
public class DataInitService {
    private ExecutorService executorService= Executors.newFixedThreadPool(4);

    private static DataInitService dataInitService=new DataInitService();

    public static DataInitService getInstance(){
        if(dataInitService!=null){
            return dataInitService;
        }else {
            dataInitService=new DataInitService();
            return dataInitService;
        }
    }

    public void init(Runnable runnable){
        executorService.submit(runnable);
    }
}
